package com.ia.aistream.service.operating.impl;

import java.util.List;
import com.ia.aistream.common.utils.DateUtils;
import com.ia.aistream.mapper.operating.DocApprovalMapper;
import com.ia.aistream.model.operating.entity.DocApproval;
import com.ia.aistream.service.operating.IDocApprovalService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.ia.aistream.common.core.text.Convert;

/**
 * 文档审批记录表Service业务层处理
 * 
 * @author aistream
 * @date 2021-01-25
 */
@Service
public class DocApprovalServiceImpl implements IDocApprovalService
{
    @Autowired
    private DocApprovalMapper docApprovalMapper;

    /**
     * 查询文档审批记录表
     * 
     * @param id 文档审批记录表ID
     * @return 文档审批记录表
     */
    @Override
    public DocApproval selectDocApprovalById(Long id)
    {
        return docApprovalMapper.selectDocApprovalById(id);
    }

    /**
     * 查询文档审批记录表列表
     * 
     * @param docApproval 文档审批记录表
     * @return 文档审批记录表
     */
    @Override
    public List<DocApproval> selectDocApprovalList(DocApproval docApproval)
    {
        return docApprovalMapper.selectDocApprovalList(docApproval);
    }

    /**
     * 新增文档审批记录表
     * 
     * @param docApproval 文档审批记录表
     * @return 结果
     */
    @Override
    public int insertDocApproval(DocApproval docApproval)
    {
        docApproval.setCreateTime(DateUtils.getNowDate());
        return docApprovalMapper.insertDocApproval(docApproval);
    }

    /**
     * 修改文档审批记录表
     * 
     * @param docApproval 文档审批记录表
     * @return 结果
     */
    @Override
    public int updateDocApproval(DocApproval docApproval)
    {
        docApproval.setUpdateTime(DateUtils.getNowDate());
        return docApprovalMapper.updateDocApproval(docApproval);
    }

    /**
     * 删除文档审批记录表对象
     * 
     * @param ids 需要删除的数据ID
     * @return 结果
     */
    @Override
    public int deleteDocApprovalByIds(String ids)
    {
        return docApprovalMapper.deleteDocApprovalByIds(Convert.toStrArray(ids));
    }

    /**
     * 删除文档审批记录表信息
     * 
     * @param id 文档审批记录表ID
     * @return 结果
     */
    @Override
    public int deleteDocApprovalById(Long id)
    {
        return docApprovalMapper.deleteDocApprovalById(id);
    }
}
